import tensorflow as tf
import os
from tqdm import tqdm


datadir = "out/"
datafiles = os.listdir(datadir)

for dfile in tqdm(datafiles):
    input_file = os.path.join(datadir, dfile)
    for seralized_example in tf.compat.v1.io.tf_record_iterator(input_file):
        example = tf.train.Example()
        example.ParseFromString(seralized_example)
        features = example.features.feature
        dstr = features["date"].bytes_list.value[0].decode("utf-8")
        datetime.datetime.strptime(dstr, "%Y-%m-%d")
